/**
 * 应用程序配置常量
 * 集中管理API地址、WebSocket连接参数等配置
 */

// API配置
export const API_CONFIG = {
  BASE_URL: 'http://locahost:5068',
  TIMEOUT: 5000,
  HEADERS: {
    'Content-Type': 'application/json'
  }
} as const;

// WebSocket配置
export const WEBSOCKET_CONFIG = {
  BASE_URL: 'ws://localhost:5068',
  ENDPOINTS: {
    ECHARTS: '/ws/jcw',
    POLICE: '/ws/police',
    POSITION: '/ws/position'
  },
  RECONNECT: {
    MAX_ATTEMPTS: 5,
    DELAY: 3000
  }
} as const;

// 图表配置
export const CHART_CONFIG = {
  MAX_DATA_LENGTH: 5000,
  BASE_DATA_COUNT: 200,
  DEFAULT_COLORS: {
    PRIMARY: '#5470C6',
    SUCCESS: '#91CC75',
    WARNING: '#FFA500',
    DANGER: '#FF0000',
    INFO: '#3F51B5',
    SECONDARY: '#7CB342'
  },
  GRID: {
    MARGIN: 1,
    LEFT: '8%',
    RIGHT: '5%'
  }
} as const;

// 数据字段映射
export const DATA_FIELD_MAPPING = {
  '速度': 'SpeedList',
  '接触力': 'X2',
  '加速度': 'WearList',
  '网压': 'Y2',
  '拉出值': 'X1',
  '导高': 'Y1',
  '磨耗表': 'MoHaoList'
} as const;

// 图表类型配置
export const CHART_TYPES = {
  LINE: 'line',
  BAR: 'bar'
} as const;

// 标记点配置
export const MARK_POINT_CONFIG = {
  SUPPORT: {
    symbol: 'triangle',
    symbolRotate: 180,
    symbolSize: 20,
    color: '#FF0000'
  },
  SUSPENSION: {
    symbol: 'circle',
    symbolSize: 12,
    color: '#FF0000'
  }
} as const;